<template>
  <div>
    <h2>Home</h2>
    {{ $route.query }}
  </div>
</template>
<script>
export default {
  beforeRouteEnter(to, from, next) {
    console.log('Home beforeRouteEnter');
    next((vm) => {
      console.log(vm);
      console.log('Home beforeRouteEnter (next)');
    })
  },
}
</script>

<script setup>
import { onBeforeRouteUpdate } from 'vue-router';

onBeforeRouteUpdate((to, from) => {

  console.log('Home beforeRouteUpdate');
})

</script>